﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mesoBoard.Data.Repositories;

namespace mesoBoard.Data
{
    public partial class User
    {
        public string[] Roles()
        {
            return this.InRoles.Select(x => x.Role.Name).ToArray();
        }

        public bool IsInRole(string RoleName)
        {
            return this.Roles().FirstOrDefault(x => x.ToLower() == RoleName.ToLower()) == null ? false : true;
        }
    }
}
